<template>
  <div>
    这是总数{{showSum}}
    <el-button @click="del">减一</el-button>
    <el-button @click="delM">减一Mutation</el-button>
    <el-button @click="delMNpage">减N</el-button>
    <el-button @click="delMNTime(9)">减N延迟</el-button>
  </div>
</template>
<script>
import { mapActions, mapMutations } from 'vuex'
export default {
  data () {
    return {
    }
  },
  mounted () {

  },
  computed: {
    showSum () {
      return this.$store.state.sum
    },

  },
  methods: {
    ...mapMutations(['delMN']),
    ...mapActions(['delMNTime']),
    del () {
      this.$store.state.sum -= 1
    },
    delM () {
      this.$store.commit('delM')
    },
    delMNpage () {
      // this.$store.commit('delMN', 3)
      this.delMN(3)
    },
  }
}
</script>

<style scoped>
#container {
  padding: 0px;
  margin: 0px;
  width: 100%;
  height: 800px;
}
</style>
